﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Battle
{
    public class Buff_Dot : BuffHandlerBase<ICanHitObj>
    {
        public Buff_Dot(string name, EM_BuffAddType buffAddType = EM_BuffAddType.Normal) : base(name, buffAddType)
        {
        }

        public override string[] OnUpdate(IBuffMgr buffMgr, ST_ObjBuffData[] buffDatas, float deltaTime)
        {
            if (buffMgr == null || buffDatas == null) return null;

            int dmg = 0;
            for (int i = 0; i < buffDatas.Length; i++)
            {
                dmg += buffDatas[i].nNum;
            }

            ICanHitObj obj = buffMgr.GetObj<ICanHitObj>();
            obj.OnHit(new ST_HitActionData()
            {
                fAtk = dmg * deltaTime
            });

            return null;
        }
    }
}
